<include file="Public:header"/>
<div class="cat" style="margin-top:5px;">
<table bordercolor="#DDDFFF" border="1" width="100%" style="border-collapse: collapse" cellpadding="3">
	<tr height="17" align="center">
		<td class="title" width="40">排序</td>
		<td class="title" width="100">品牌</td>
		<td class="title" width="100">logo</td>
		<td class="title" width="100">url</td>
		<td class="title" width="100">推荐</td>
		<td class="title">　</td>
	</tr>
	<tr height="20" bgcolor="#F1F5FA" class="cat_list">
		<td width="40"><input type="text" name="sorting" value="{$brand.sorting}" size="5"></td>
		<td width="100"><input type="text" name="bname" value="{$brand.brand_name}"></td>
		<td width="100"><input type="text" name="blogo" value="{$brand.brand_logo}"></td>
		<td width="100"><input type="text" name="burl" value="{$brand.brand_url}"></td>
		<td width="100">
<if condition="$brand.is_hot eq 'false' ">
        <input type="radio" value="false" name="ishot" checked>否
        <input type="radio" value="true"  name="ishot">是
<else/>
        <input type="radio" value="false" name="ishot">否
        <input type="radio" value="true"  name="ishot" checked>是
</if>
		</td>
		<td></td>
	</tr>
</table>
</div>

<input type="text" name="bid" value="{$brand.brand_id}" style="display:none">
<div id="save"><input type="button" id="change" value="保存修改"></div>

<script>
$(function(){
   $("#change").click(function(){
       var bid=$("[name=bid]").val();
	   var sort=$("[name=sorting]").val();
	   var bname=$("[name=bname]").val();
	   var blogo=$("[name=blogo]").val();
	   var burl=$("[name=url]").val();
	   var ishot=$("[name=ishot]:checked").val();
	   
	   $.ajax({
	       type:"POST",
		   url:"__URL__/save_edit",
		   dataType:"json",
		   data:{'bid':bid,'sort':sort,'bname':bname,'blogo':blogo,'burl':burl,'ishot':ishot},
		   success:function(data){
		     if(data=='1'){
			 jSuccess("<strong>修改成功!</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
			 }else{
			 jError("<strong>修改失败!请重试</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
			 }
		   }
	   })


   })

})
</script>



